import {useHistory} from 'react-router-dom'
import React from 'react';

const AuthRouter = (Cmp) => {

  const history = useHistory();

  const checkLogin = () => {
    return false
  }

  return (
    <>
      {
        checkLogin() ?
          <Cmp/>
          :
          history.push('/login')
      }
    </>
  );
}

export default AuthRouter;



